//
//  RequestsHandler.m
//  Exchange
//
//  Created by Александр Лазарекно on 09.12.12.
//  Copyright (c) 2012 Бонч. All rights reserved.
//

#import "RequestsHandler.h"
#import "Connector.h"
#import "SoapRequests.h"
#import "GDataXMLNode.h"
#import "XMLParser.h"

@implementation RequestsHandler

-(void) sendRequestWithBody:(NSData*) SOAPRequest
{
    Connector* connection = [[Connector alloc]initWithDelegate:self];
    [connection sendRequestToServerWithBody:SOAPRequest];
}
-(void) syncFolderHierarchyUsingSyncState:(NSString *)syncState
{
    [self sendRequestWithBody:[SoapRequests XMLRequestSyncFolderHierarchyUsingSyncState:syncState]];
}
-(void) didFinishLoadingData:(NSMutableData*) data
{
    
    GDataXMLDocument *response = [[GDataXMLDocument alloc] initWithData:data options:0 error:nil];
    [XMLParser syncFolderHierarchyParse:response];
    
}



@end
